<template>
  <table class="pure-table">
    <thead>
      <tr>
        <th>参数</th>
        <th>类型</th>
        <th>描述</th>
        <th>子参数</th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="(val,response) in properties" :key="response">
        <td>{{response}}</td>
        <!-- 列表对象 -->
        <td>
          {{val.type}}
        </td>
        <td>
          {{val.description}}
        </td>
        <td>
          <template v-if="val.items && val.items.originalRef">
            <RefTable :properties='definitions[val.items.originalRef].properties' :definitions="definitions" />
          </template>
          <template v-if="val.originalRef && definitions[val.originalRef]">
            <RefTable :properties='definitions[val.originalRef].properties' :definitions="definitions" />
          </template>
        </td>
      </tr>
    </tbody>
  </table>
</template>
<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "RefTable",
  props: {
    properties: {
      default: () => ({}),
      type: [Object, Array],
    },
    definitions: {
      default: () => ({}),
      type: Object,
    },
  },
  //   setup() {},
});
</script>
<style lang="less" scoped>

</style>